package cn.sciento.boot.platform.rule.helper;

import java.util.Map;

import cn.sciento.boot.platform.rule.entity.ScriptResult;
import cn.sciento.boot.platform.rule.service.RuleEngineService;

import cn.sciento.core.convertor.ApplicationContextHelper;

/**
 * 运行脚本方法
 *

 */
public class RuleEngineHelper {

    private RuleEngineHelper() {
    }

    public static ScriptResult runScript(String scriptCode, Long tenantId, Map<String, Object> params) {
        RuleEngineService ruleEngineService = ApplicationContextHelper.getContext().getBean(RuleEngineService.class);
        return ruleEngineService.ruleScriptResult(scriptCode, tenantId, params);
    }
}
